const commonjs = require('@rollup/plugin-commonjs')
const json = require('@rollup/plugin-json')
const resolve = require('@rollup/plugin-node-resolve')
const terser = require('@rollup/plugin-terser')
const typescript = require('@rollup/plugin-typescript')

module.exports = {
  input: 'index.ts',
  output: [
    {
      file: 'dist/index.js',
      format: 'cjs',
      sourcemap: false,
      name: 'smartCabinet',
    },
  ],
  plugins: [
    resolve({
      preferBuiltins: true,
      browser: false,
    }),
    commonjs({
      ignoreDynamicRequires: true,
    }),
    json(),
    typescript({
      tsconfig: './tsconfig.json',
      declaration: false,
    }),
    terser(),
  ],
}
